﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace ColladaDotNet
{
	public class Set<T> : IEnumerable<T>
	{
		
		Dictionary<T,bool> map = new Dictionary<T, bool>();

		private static bool val = true;

		public int Count
		{
			get
			{
				return map.Count;
			}
		}

		public void Add(T j)
		{
			map[j] = val;
		}

		/// <summary>
		/// Returns an enumerator that iterates through the collection.
		/// </summary>
		/// <returns>
		/// A <see cref="T:System.Collections.Generic.IEnumerator`1"></see> that can be used to iterate through the collection.
		/// </returns>
		/// <filterpriority>1</filterpriority>
		IEnumerator<T> IEnumerable<T>.GetEnumerator()
		{
			foreach (var pair in map)
			{
				yield return pair.Key;
			}
		}

		public IEnumerator GetEnumerator()
		{
			foreach (var pair in map)
			{
				yield return pair.Key;
			}
		}

		public T[] ToArray()
		{
			var res = new T[map.Count];
			int i=0;
			foreach (var pair in map)
			{
				res[i] = pair.Key;
				++i;
			}
			return res;
		}

		public void Clear()
		{
			map.Clear();
		}
	}

	public class MtoN<M,N>
	{
	}

	public class MtoNRepository<M,N>
	{
		
	}
}
